﻿using System.Windows;
using System.Windows.Input;

namespace MyFloridaHouse.SilverlightOpenDistricts
{
    public partial class xFind : System.Windows.Controls.UserControl
    {
        public xFind()
        {
            InitializeComponent();
        }


        private void btn_AddressFind_Click(object sender, RoutedEventArgs e)
        {
            //GeocodeAddress(txtBx_Address.Text);
            MessageBox.Show("TODO: Need to fire Geocode here");

        }

        private void btn_ComboClear_Click(object sender, RoutedEventArgs e)
        {
            txtBx_Address.Text = "";
        }

        private void txtBx_Address_GotFocus(object sender, RoutedEventArgs e)
        {
            txtBx_Address.SelectAll();
        }

        private void txtBx_Address_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                btn_AddressFind_Click(btn_AddressFind, new RoutedEventArgs());
            }
            else
            {
                e.Handled = true;
            }
        }

    }
}
